package Exists;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class Demo03 {
    public static void main(String[] args) {

        LocalDateTime  res = LocalDateTime.of(1998, 03, 18, 17, 19,28);

        String  num = res.format(DateTimeFormatter.ofPattern("yyyy-MM月-dd---HH:mm分ss秒"));

        System.out.println(num);

       //int转String
        LocalDateTime   res1 =   LocalDateTime.of(2020,12,12,12,23,43 );
         String  num1 = res1.format(DateTimeFormatter.ofPattern("yyyy年MM月dd日 HH时mm分ss秒"));

       //字符串转int
         LocalDateTime num2 = LocalDateTime.parse(num1,DateTimeFormatter.ofPattern("yyyy年MM月dd日 HH时mm分ss秒"));


        System.out.println(num2);
   }


}
